package com.envper.controller.alarm;

import com.envper.common.domain.dto.AlarmDto;
import com.envper.common.service.alarm.AlarmService;
import com.envper.mysql.domain.Result;
import com.envper.mysql.domain.Status;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequiredArgsConstructor
@RequestMapping("/alarm")
public class AlarmController {

    private final AlarmService alarmService;

    @GetMapping("/list")
    public Result<List<AlarmDto>> getAlarmList() {
        List<AlarmDto> alarmList = alarmService.getAlarmList();
        return Result.ok(Status.SUCCESS, alarmList);
    }

}
